package com.mce.nebula.enums;

/**
 * 应用升级记录类型枚举
 */
public enum AppUpgradeRecordType {
    UPGRADE("upgrade", "升级"),
    ROLLBACK("rollback", "回滚");

    private final String value;
    private final String description;

    AppUpgradeRecordType(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public String getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static AppUpgradeRecordType fromValue(String value) {
        for (AppUpgradeRecordType type : AppUpgradeRecordType.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid AppUpgradeRecordType value: " + value);
    }
}